<?php
/**
 * Pertyler DatabaseManagement
 * Control
 * Login
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */

namespace Pertyler;

require_once __DIR__ . '/main.php';

require_once __DIR__ . '/../library/Pert/General/Page.php';

require_once __DIR__ . '/../databaseModel/Role.php';

if(isset($_POST['Login']))
	if($_POST['Login'] == 'Submit')
		if(Role_Moderator::Login($_POST['Name'],
				$_POST['Password']))
			\Pert\Page::Get()->AddScript('
parent.topMenu.document.location.reload();');

if(Role_Moderator::Select())
	return false;

echo \Pert\Page::Get()->HeaderHTML();

require __DIR__ . '/../view/Login.php';

echo \Pert\Page::Get()->FooterHTML();

return true;
